package ru.jetsoft.reg112.desktop.control;

import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import ru.jetsoft.reg112.desktop.data.Param;

public abstract class InputParamControl extends ParamControl {

    private final HBox hBox;

    public InputParamControl(Param param) {
        super(param);
        hBox = new HBox();
        hBox.setSpacing(5);
        hBox.setPadding(new Insets(2, 2, 2, 2));
        hBox.setAlignment(Pos.CENTER_LEFT);
        Label title = new Label(param.getName());
        title.setWrapText(true);
        title.setMinWidth(300);
        title.setMaxWidth(300);
        hBox.getChildren().add(title);
    }

    protected HBox getHBox() {
        return hBox;
    }

    @Override
    public Node getNode() {
        return hBox;
    }
}
